<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

class ControlItemContentBase extends ControlItemBase {
	var $actionHandler = '1';
	var $displayHandler = '0';
	
	//constructor
	function ControlItemContentBase($config = '') {
		parent::ControlItemBase($config);	
	}
	
	//methods
	function _doActionHandler() {
		if( $this->_check_action('setfield') ) {
			$ids = util_get_param($_POST, 'cb');
			$field = util_get_param($_POST, 'field');
			if( is_array($ids) ) {
				if( $field == 'delete' ) {
					$this->modelObj->deleteItems($ids);
					//
					$this->_redirect('', array('id','op','action'), 's');
				} else {
					$this->modelObj->updateItemsF($ids, $field);
					//
					$this->_redirect('', array('action'), 's');
				}
			}
		} elseif( $this->_check_action('moveitems') ) {
			$ids = util_get_param($_POST, 'cb');
			$tocid = util_get_param($_POST, 'tocid');
			if( is_array($ids) ) {
				$this->modelObj->updateItemsCategory($ids, $tocid);
				$this->_redirect('', array('action'), 's');
			}
		}
		
		return parent::_doActionHandler();
	}
	
	function _doDisplayHandler() {
		return parent::_doDisplayHandler();
	}
}
//
?>